package com.atguigu.gulimall.member.controller;

import com.atguigu.common.utils.PageUtils;
import com.atguigu.common.utils.R;
import com.atguigu.gulimall.member.feignService.TestMemberFignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author: tangzp
 * @Date: 2021/12/1 8:56
 * @Description:
 */
@RefreshScope
@RestController
@RequestMapping("member/test")
public class TestMemberFignController {

    @Autowired
    TestMemberFignService testMemberFignService;

    @Value("${member.userName}")
    String userName;

    @Value("${member.userAge}")
    String userAge;

    @RequestMapping("/list")
    public R getTestInfo(@RequestParam Map<String, Object> params){
        return testMemberFignService.queryPage(params);
    }

    @GetMapping(value = "/getProInfo")
    public R getProInfo(){
        return R.ok().put("userName",userName).put("userAge",userAge);
    }

}
